        TITL DAI FIRMWARE 0ECF8-0EE08  V1.1
        ORG   :ECF8
*
***********************************
* POINTERS LIST HANDLING ROUTINES *
***********************************
*
* Table with addresses of listroutines for the
* part of a statement after a token.
*
* Startaddress table is ECF8. The offset (given
* between brackets) is identical to the data
* byte after the addresses in the table on CD8B.
*
L0E355  DBL   SCN1      (00)  nothing more
        DBL   SCN2      (01)  linenr
        DBL   SCN3      (02)  linenr linenr
 REM       (not used)
        DBL   SCN5      (03)  unquoted string
        DBL   SCN6      (04)  E (E=expr)
        DBL   SCN7      (05)  E,E
        DBL   SCN8      (06)  E E
        DBL   SCN9      (07)  E,E E
        DBL   SCN10     (08)  E,E E,E E
        DBL   SCN11     (09)  E E E E
        DBL   SCN12     (0A)  E
        DBL   SCN13     (0B)  liner-linenr
        DBL   SCN14     (0C)  sound
        DBL   SC14A     (0D)  noise
        DBL   SCN15     (0E)  envelope
        DBL   SCN16     (0F)  mode
        DBL   SCN17     (10)  input <string>
        DBL   SCN18     (11)  input/read/dim
        DBL   RDM40     (12)  (not used [*])
        DBL   SCN20     (13)  let
        DBL   SCN21     (14)  if then <E>
        DBL   SCN22     (15)  if goto <linenr>
        DBL   SC22A     (16)  if then <linenr>
        DBL   SCN23     (17)  for to step
        DBL   SCN24     (18)  next
        DBL   SCN25     (19)  print
        DBL   SCN26     (1A)  on goto
        DBL   SCN27     (1B)  on gosub
        DBL   SCN28     (1C)  callm
        DBL   RTK40     (1D)  (not used [*])
        DBL   SCN30     (1E)  savea/loada
*
* The vectors marked with [*] are no pointers to
* LIST routines.
*
        DATA  :FF
        DATA  :FF
        DATA  :FF
        DATA  :FF
*
*******************************
* LIST NO FURTHER EXPRESSIONS *
*******************************
*
SCN1    RET
*
***************************
* LIST 1 OR 2 LINENUMBERS *
***************************
*
* SCN2: List 1 line number.
* SCN3: List 2 line numbers, separated by space.
*       (This last entry is not used).
*
* Exit: BC updated, DE preserved, AFHL corrupted.
*
SCN3    CALL  L0E318    List linenr
        CALL  SCHSP     Print space
SCN2    JMP   L0E318    List linenr
*
************************
* LIST UNQUOTED STRING *
************************
*
SCN5    JMP   SUQTS     List unquoted string
*
**********************
* LIST <EXPR>,<EXPR> *
**********************
*
* Exit: BC updated, DE preserved, AFHL corrupted.
*
SCN7    CALL  SCEXP     List <expr>
SCOEX   CALL  SCHCO     Print ','
SCN6    JMP   SCEXP     List <expr>
*
************************************
* LIST <EXPR> <EXPR> <EXPR> <EXPR> *
************************************
*
* Exit: BC updated, DE preserved, AFHL corrupted.
*
SCN11   CALL  SEXPS     List <expr>; print space
S3EXP   CALL  SEXPS     Idem
SCN8    CALL  SEXPS     Idem
        JMP   SCEXP     List <expr>
*
*******************************************
* LIST <EXPR>,<EXPR> <EXPR>,<EXPR> <EXPR> *
*******************************************
*
* Exit: BC updated, DE preserved, AFHL corrupted.
*
SCN10   CALL  SCN7      List <expr>,<expr>
        CALL  SCHSP     Print space
SCN9    CALL  SCN7      List <expr>,<expr>
SCSEX   CALL  SCHSP     Print space
L0E343  JMP   SCEXP     List <expr>
*
*******************************
* LIST <EXPR>,<EXPR>(,<EXPR>) *
*******************************
*
SCN12   CALL  SCN7      List <expr>,<expr>
S1210   LDAX  B         Get next byte
        CPI   :FF       Terminator?
        INX   B
        RZ              Then abort
        DCX   B
        CALL  SCHCO     Print ','
        JMP   SCEXP     List <expr>
*
**************************
* LIST <LINENR>-<LINENR> *
**************************
*
* Exit: BC updated, DE preserved, AFHL corrupted.
*
SCN13   CALL  L0E318    List linenr
        CALL  SCHRI     Print '-'
        DATA  :2D
        JMP   L0E318    List linenr
*
*********************************
* LIST EXPRESSION AFTER 'SOUND' *
*********************************
*
* Exit: BC updated, AFHL corrupted.
*       DE: preserved if ON, corrupted if OFF.
*
SCN14   LDAX  B         Get byte
        CPI   :FF       OFF sign?
        CNZ   SEXPS     If not: List <expr>, print
 REM space
        LDAX  B         Get next byte
        CPI   :FF       OFF sign?
        JNZ   SCN11     If not: List <expr> <expr>
 REM <expr> <expr>; abort
S1410   CALL  STXTS     Else: print 'OFF'
        DBL   L0E354  
        INX   B
        RET
*
* DATA:
*
L0E354  DATA  :03
        DATA  :4F       O
        DATA  :46       F
        DATA  :46       F
*
*********************************
* LIST EXPRESSION AFTER 'NOISE' *
*********************************
*
* Exit: BC updated, E preserved, AFDHL corrupted.
*
SC14A   LDAX  B         Get 1st byte NCB
        CPI   :FF       OFF sign?
        JZ    S1410     Then print 'OFF', abort
        JMP   SCN8      Else: List <expr> <expr>
*
************************************
* LIST EXPRESSION AFTER 'ENVELOPE' *
************************************
*
* Exit: BC updated, E preserved, AFDHL corrupted.
*
SCN15   CALL  SEXPS     List <expr>, print
 REM space
        LDAX  B         Get length of expr
        INX   B
        MOV   D,A       into D
S1510   DCR   D
        JM    S1520     If ready
        CALL  SCN7      List <V>,<T>
        CALL  SCHRI     Print ';'
        DATA  :3B
        JMP   S1510     Next <V>,<T>
S1520   LDAX  B         Get last byte of expr
        INX   B
        CPI   :FF       Terminator?
        RZ              Then abort
        DCX   B
        JMP   SCEXP     List <expr>
*
********************************
* LIST EXPRESSION AFTER 'MODE' *
********************************
*
SCN16   LDAX  B         Get mode byte
        INX   B
        MVI   D,:30
        ORA   A         Mode 0 (FF) ?
        JM    S1610     Then print '0'
        RAR             CY=1 if A-mode
RSA10   INR   A
        PUSH  PSW
        ADD   D         Convert to ASCII
        CALL  OUTC      Print modenr
        POP   PSW
        CMC
        MVI   D,:41     Prepare print 'A'
S1610   MOV   A,D
        CNC   OUTC      Print 'A' if A-mode
        RET
*
**********************************************
* LIST EXPRESSION AFTER 'INPUT'-'READ'-'DIM' *
**********************************************
*
* Input with string:
 REM
SCN17   CALL  SCEXP     List string
        CALL  SCHRI     Print ';'
        DATA  :3B
 REM
* Rest:
 REM
SCN18   LDAX  B         Get nr of variables
        INX   B
        MOV   D,A       into D
S1810   PUSH  D
        CALL  L0E305    List variable reference
        POP   D
        DCR   D         Decr nr of variables
        RZ              Abort if ready
        CALL  SCHCO     Print ','
        JMP   S1810     List next variable
*
****************************************
* part of RUN 'DIM': CALC. REQD. SPACE *
****************************************
*
RDM40   JNZ   HLMUL     If length element <= 254:
 REM then HL=HL*A
        MOV   A,H       Else:
        ORA   A         Set flags on hibyte
        MOV   H,L
        MVI   L,:00
        RZ              Abort if H=0
        STC             Else: CY=1, L into H
        RET
*
************************
* RUBBISH - (not used) *
************************
*
L0E352  DATA  :CE
        DATA  :C3
        DATA  :F4
        DATA  :ED
*
*******************************
* LIST EXPRESSION AFTER 'LET' *
*******************************
*
* Entry: BC: Points to assign statement.
* Exit:  BC updated, AFDEHL corrupted.
*
SCN20   CALL  L0E305    List lefthand variable
 REM reference
        CALL  SCHRI     Print '='
        DATA  :3D
        JMP   SCEXP     List righthand expr
*
        UNL
OUTC    EQU   :DD60
SCN21   EQU   :EE09
SCN22   EQU   :EE1A
SC22A   EQU   :EE25
SCN23   EQU   :EE30
SCN24   EQU   :EE4F
SCN25   EQU   :EE52
SCN26   EQU   :EE66
SCN27   EQU   :EE71
SCN28   EQU   :EE87
RTK40   EQU   :EE94
SCN30   EQU   :D89E
L0E318  EQU   :EFAE
SCHSP   EQU   :CE6B
SUQTS   EQU   :EFED
SCEXP   EQU   :EEA2
SCHCO   EQU   :CE70
SEXPS   EQU   :EFFC
SCHRI   EQU   :EFF5
STXTS   EQU   :CE78
L0E305  EQU   :EEFC
HLMUL   EQU   :DE8F
        LST
        END
